package com.bestcem.xm.txtanls.controller;

import com.bestcem.xm.common.core.domain.web.ServiceResult;
import com.bestcem.xm.common.core.domain.web.XmResultJson;
import com.bestcem.xm.txtanls.controller.vo.model.TrainModelVO;
import com.bestcem.xm.txtanls.service.TrainModelService;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 模型controller
 *
 * @author liheng
 * @version v1.0
 * @date 2022/3/9 15:05
 */
@RestController
@RequestMapping(value = "/txtanls/model", produces = MediaType.APPLICATION_JSON_VALUE)
public class TrainModelController {

    @Resource
    private TrainModelService trainModelService;

    /**
     * 获取训练模型列表
     *
     * @return 训练模型列表
     */
    @GetMapping("/")
    public XmResultJson<List<TrainModelVO>> listModel() {
        ServiceResult<List<TrainModelVO>> listServiceResult = trainModelService.listTrainModel();
        return XmResultJson.success(listServiceResult.getData());
    }


}
